//4.5 - The Cave Adventure Game - Dirk Henkemans //Prima Publishing #include #include using namespace std; bool intro(void); void room(bool enemy, bool treasure, string description); //player stats string name = ""; //enemy stats string enemyName = ""; //treasure stats string treasureName = ""; //room descriptions; const string room1 = "You enter the mouth of the caves."; const string room2 = "You adventure deeper into the caves."; const string room3 = "You have reached the depths of the caves."; int main( void ) { if (intro()) return 0; //exit the program treasureName = "gold sword"; enemyName = "goblin"; room(true, true, room1); enemyName = "wombat"; room(true, false, room2); enemyName = "hobgoblin lord."; treasureName = "treasure horde."; room(true, true, room3); return 0; } //void intro(void) bool intro(void) { cout<<"Brave knight!!! What is your name? \n"; cin>>name; cout<<"We are in need of your help "<< name <<", our village is being over run \nby " <<"the goblins of the northern caves. Will " << " you accept the challenge? \n \n"; cout<<"1) yes \n" <<"2) no \n \n"; int response; cin>>response; return !(response == 1); } //void room(bool enemy, bool tresure, string description) //Displays the description for the room and gives options void room(bool enemy, bool treasure, string description) { while(true) { cout<>response; } while(response < 1 || response > 2); switch(response) { case 1: if(enemy) { enemy = !enemy; cout<<"You slay the deadly " <